All Questions
14 questions
1vote
2answers
122views
Designing UI module for an application
I have an UI module that will expose only one class - UserInterface. The class will be responsible for collecting user input and providing output (command line UI style). From logical way of thinking, ...
1vote
1answer
609views
Pipeline design pattern and immutability
I'm developing a backend service that is supposed to process items in a pipeline-fashion. Each stage is essentially a Function<IN, OUT>. So the current stage's input is the previous stage's ...
3votes
4answers
1kviews
Role of DTOs in Rich Domain Model
I work with Spring applications. Recently I have found this article about the Anemic Domain Model. They recommend putting logic in Entity classes. It solves a problem that Martin Fowler described in ...
25votes
4answers
42kviews
Service layer returns DTO to controller but need it to return model for other services
Following this post https://stackoverflow.com/questions/21554977/should-services-always-return-dtos-or-can-they-also-return-domain-models and best practices in Software Arch suggestions by Martin ...
7votes
5answers
3kviews
Design pattern for 2 methods one has 70% arguments of other one
I am trying to do a design for notification part in the system I have 2 parts inApp notification and email notification so I used strategy pattern where I have interface NotificationSender with one ...
0votes
2answers
138views
design discussion, user experience first or correctness first in our case
We are discussing the system configuration module design in our Java medical device software. The system has a voice instruction function used to guide patient during the examination. Different ...
4votes
2answers
896views
Clean Architecture: get instance in inner circle of class from outer circle
This might be an easy question for experienced software engineers. I'm currently reading the book Clean Architecture by Uncle Bob, and I'm trying to implement clean architecture in a Java project. ...
1vote
1answer
131views
Using constructors for "layered" instances
I'm working on a library that can represent LED strips virtually. My main class, LEDStrip, is abstract and has a couple abstract methods, like getLength() and setColor(int index, Color c). This lets ...
3votes
2answers
1kviews
Value object that depends on multiple aggregates' lifecycle in DDD
During prototyping a simple ddd application from public transit domain I've faced a problem with one value object - Transit Pass: Each Customer can buy a transit Pass thatallows a passenger of the ...
3votes
2answers
11kviews
Unit testing / How to validate private fields of a newly created object?
I have a basic unit test (for the sample) that involves this code: void testShouldCreateACar() { Car car = someone.createFerrari(); assertTrue(car.name == "Ferrari"); // can't access name since ...
2votes
2answers
1kviews
DDD Request Validation Handling
I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
2votes
2answers
2kviews
Problems with OO design for application with pluggable components
I'm trying to refactor an ugly code and make it easly extendable in the future. The application should be nothing else but a series of components that have input(s) and output(s). The components ...
2votes
2answers
2kviews
From a DDD perspective is a report generating service a domain service or an infrastructure service?
Let assume we have the following service whose responsibility is to generate Excel reports: class ExcelReportService{ public String generateReport(String fileFormatFilePath, ResultSet data){ ...
4votes
1answer
226views
Which relationship is more natural?
Have a quick question on how to best structure something for my Java project: I'm a user. I can work at one or more places. At those workplaces, I have one or more roles. For each of these roles, I ...